<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>TTSDemo</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="quicktime/ac_quicktime.js"></script>
<script src="quicktime/quicktime_tts.js"></script>
<script src="quicktime/quicktime_event.js"></script>

<script type="text/javascript">
	$(document).ready(function() {
	    //checkStorageSupport();
        //haveQuicktime();
        
		$("#submit").click(function() {
			var paragraph = $("#paragraph").val();
            try{
			     speak(paragraph);
            }catch(err){
                alert(err);
            }  
		});
        
        try{
            register();
        }catch(err){
            alert(err);
        }
	});
</script>
</head>
<body>
	<h1>Quicktime TTS Demo</h1>
	<div id="container">
			<h2>Nhap mot doan text:</h2>
			<textarea id="paragraph" rows="10" cols="30"></textarea>
			<button id="submit">submit</button>
	</div>

    <table>
       <tr>
           <td >
               <script  type="text/javascript">
        
               QT_WriteOBJECT('media/love.mp3', '180','160', '','obj#id', 'movie1', 'emb#name', 'movie1', 'enablejavascript', 'true');
        
               </script>
           <p> Movie1 </p>
           </td>

           <td>
               <script type="text/javascript">
        
               QT_WriteOBJECT('media/anh.mp3', '180','160', '','obj#id', 'movie2', 'emb#name', 'movie2', 'enablejavascript', 'true');
        
               </script>
           <p> Movie2 </p>
           </td>
       </tr>
    </table>
    
    <p>Play and Stop Movies: <br/>
     <a href="javascript:document.movie1.Play();">Play Movie1</a><br/>
     <a href="javascript:document.movie1.Stop();">Stop Movie1</a><br/>
     <a href="javascript:document.movie2.Play();">Play Movie2</a><br/>
     <a href="javascript:document.movie2.Stop();">Stop Movie2</a><br/>
     </p>
    
     <p>Replace One Movie with Another: <br/>
     <a href="javascript:document.movie1.SetURL('anh.mp3');">movie1.SetURL(media/anh.mp3)</a>
     <br/>
     <a href="javascript:document.movie1.SetURL('love.mp3');">movie1.SetURL(media/love.mp3)</a>
     </p>
     
     <script>
        QT_WriteOBJECT('media/video.mp4', '320', '240','','obj#id', 'video','emb#name','video','emb#id','video_embed','enablejavascript','true','postdomevents','true');
     </script>
     <div id="status">Begin Loading....</div>
</body>
</html>